/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package gui.frames.internos;

import controle.gui.frames.internos.ControleSincronizacao;
import controle.gui.superclasses.InternalFrame;

/**
 *
 * @author maycon
 */
public class IFSincronizacao extends InternalFrame {

    //Classe de controle
    private ControleSincronizacao controle = new ControleSincronizacao(this);
    
    /**
     * Creates new form IFSincronizacao
     */
    public IFSincronizacao() {
        initComponents();
        this.setVisible(true);
        this.inicializa();
    }

    @Override
    public void inicializa(){
        controle.inicializa();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        panelOpcoes = new javax.swing.JPanel();
        buttonConectar = new javax.swing.JButton();
        buttonParar = new javax.swing.JButton();
        panelLog = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        textLog = new javax.swing.JTextArea();

        setClosable(true);
        setIconifiable(true);
        setMaximizable(true);
        setTitle("Sincronização");
        setPreferredSize(new java.awt.Dimension(600, 600));

        panelOpcoes.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Opções", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION));

        buttonConectar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/Sincronizar.png"))); // NOI18N
        buttonConectar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonConectarActionPerformed(evt);
            }
        });

        buttonParar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/Parar.png"))); // NOI18N
        buttonParar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonPararActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout panelOpcoesLayout = new javax.swing.GroupLayout(panelOpcoes);
        panelOpcoes.setLayout(panelOpcoesLayout);
        panelOpcoesLayout.setHorizontalGroup(
            panelOpcoesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelOpcoesLayout.createSequentialGroup()
                .addComponent(buttonConectar)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(buttonParar)
                .addContainerGap())
        );
        panelOpcoesLayout.setVerticalGroup(
            panelOpcoesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(buttonConectar)
            .addComponent(buttonParar)
        );

        panelLog.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Log da Conexão", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION));

        jScrollPane1.setAutoscrolls(true);

        textLog.setColumns(20);
        textLog.setFont(new java.awt.Font("Monospaced", 0, 12)); // NOI18N
        textLog.setLineWrap(true);
        textLog.setRows(5);
        textLog.setWrapStyleWord(true);
        textLog.setDragEnabled(true);
        jScrollPane1.setViewportView(textLog);

        javax.swing.GroupLayout panelLogLayout = new javax.swing.GroupLayout(panelLog);
        panelLog.setLayout(panelLogLayout);
        panelLogLayout.setHorizontalGroup(
            panelLogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane1)
        );
        panelLogLayout.setVerticalGroup(
            panelLogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 462, Short.MAX_VALUE)
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(panelLog, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(panelOpcoes, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(panelOpcoes, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(panelLog, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void buttonConectarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonConectarActionPerformed
        controle.abreConexao();
    }//GEN-LAST:event_buttonConectarActionPerformed

    private void buttonPararActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonPararActionPerformed
        controle.paraConexao();
    }//GEN-LAST:event_buttonPararActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton buttonConectar;
    private javax.swing.JButton buttonParar;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JPanel panelLog;
    private javax.swing.JPanel panelOpcoes;
    private javax.swing.JTextArea textLog;
    // End of variables declaration//GEN-END:variables

    public ControleSincronizacao getControle() {
        return controle;
    }

    public void setControle(ControleSincronizacao controle) {
        this.controle = controle;
    }

    public javax.swing.JButton getButtonConectar() {
        return buttonConectar;
    }

    public void setButtonConectar(javax.swing.JButton buttonConectar) {
        this.buttonConectar = buttonConectar;
    }

    public javax.swing.JButton getButtonParar() {
        return buttonParar;
    }

    public void setButtonParar(javax.swing.JButton buttonParar) {
        this.buttonParar = buttonParar;
    }

    public javax.swing.JScrollPane getjScrollPane1() {
        return jScrollPane1;
    }

    public void setjScrollPane1(javax.swing.JScrollPane jScrollPane1) {
        this.jScrollPane1 = jScrollPane1;
    }

    public javax.swing.JPanel getPanelLog() {
        return panelLog;
    }

    public void setPanelLog(javax.swing.JPanel panelLog) {
        this.panelLog = panelLog;
    }

    public javax.swing.JPanel getPanelOpcoes() {
        return panelOpcoes;
    }

    public void setPanelOpcoes(javax.swing.JPanel panelOpcoes) {
        this.panelOpcoes = panelOpcoes;
    }

    public javax.swing.JTextArea getTextLog() {
        return textLog;
    }

    public void setTextLog(javax.swing.JTextArea textLog) {
        this.textLog = textLog;
    }

    
    
    }
